'use strict';

const Controller = require('egg').Controller;

class UserController extends Controller {
  async userInfo() {
    const { ctx, app } = this;
    const name = ctx.query.name
    const password = ctx.query.password
    const userInfo = await ctx.service.user.addUser(name, password);
    const success = await app.redis.set('userInfo', JSON.stringify(userInfo))
    console.log(process.env.redis)
    ctx.body = userInfo
  }
}

module.exports = UserController;
